# -*- cmake -*-

# - Find XMLRPC-EPI
# Find the XMLRPC-EPI includes and library
# This module defines
#  XMLRPCEPI_INCLUDE_DIR, where to find jpeglib.h, etc.
#  XMLRPCEPI_LIBRARIES, the libraries needed to use XMLRPC-EPI.
#  XMLRPCEPI_FOUND, If false, do not try to use XMLRPC-EPI.
# also defined, but not for general use are
#  XMLRPCEPI_LIBRARY, where to find the XMLRPC-EPI library.

FIND_PATH(XMLRPCEPI_INCLUDE_DIR xmlrpc.h
/usr/local/include
/usr/include
/opt/local/include
/usr/include/xmlrpc-epi
)

SET(XMLRPCEPI_NAMES ${XMLRPCEPI_NAMES} xmlrpc-epi)
FIND_LIBRARY(XMLRPCEPI_LIBRARY
  NAMES ${XMLRPCEPI_NAMES}
  PATHS /usr/lib /usr/local/lib /opt/local/lib
  )

IF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)
    SET(XMLRPCEPI_LIBRARIES ${XMLRPCEPI_LIBRARY})
    SET(XMLRPCEPI_FOUND "YES")
ELSE (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)
  SET(XMLRPCEPI_FOUND "NO")
ENDIF (XMLRPCEPI_LIBRARY AND XMLRPCEPI_INCLUDE_DIR)


IF (XMLRPCEPI_FOUND)
  if( VERBOSE_FIND )
	  MESSAGE(STATUS "Found XMLRPC-EPI: ${XMLRPCEPI_LIBRARIES}")
  endif( VERBOSE_FIND )
ELSE (XMLRPCEPI_FOUND)
  MESSAGE(FATAL_ERROR "Could not find XMLRPC-EPI library")
ENDIF (XMLRPCEPI_FOUND)

MARK_AS_ADVANCED(
  XMLRPCEPI_LIBRARY
  XMLRPCEPI_INCLUDE_DIR
  )

